package com.dctp.common.vo;

/**
 * 资金变动类型枚举，对应dctp_fund_flow.change_type字段
 */
public enum FundChangeType {
    RECHARGE(1, "充值"),
    WITHDRAW(2, "提现"),
    TRADE(3, "开仓手续费"),
    FEE(4, "平仓手续费"),
    CLOSE(5, "平仓盈亏"),
    TRANSFER(6, "转赠"),
    INCOME(7, "收益宝收益"),
    COMEPENSATE(8, "补偿"),
    COMMISSION(9, "佣金"),
    AMOUNT_IN_SYB(10,"转入收益宝"),
    AMOUNT_OUT_SYB(11,"收益宝转出"),
    EMS_OPS(12,"额度变更"),
    EMS_OPS2(13,"1:1额度");

    private final int code;
    private final String desc;

    FundChangeType(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static FundChangeType fromCode(int code) {
        for (FundChangeType t : values()) {
            if (t.code == code) return t;
        }
        return null;
    }
}
